<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});

Route::post('/applet_api/pay', 'App\Http\Controllers\applet_api\PayController@index')->middleware('AppMiddleware');
Route::post('/applet_api/ispay', 'App\Http\Controllers\applet_api\PayController@isPay')->middleware('AppMiddleware');
Route::post('/applet_api/wechatNotify', 'App\Http\Controllers\applet_api\PayController@wechatNotify');
Route::post('/applet_api/pay/vip', 'App\Http\Controllers\applet_api\PayController@vip')->middleware('AppMiddleware');
Route::post('/applet_api/isPayVip', 'App\Http\Controllers\applet_api\PayController@isPayVip')->middleware('AppMiddleware');
Route::post('/applet_api/wechatNotifyVip', 'App\Http\Controllers\applet_api\PayController@wechatNotifyVip');



Route::post('/applet_api/wiki', 'App\Http\Controllers\applet_api\WikiController@index')->middleware('AppMiddleware');
Route::get('/applet_api/wiki/{id}', 'App\Http\Controllers\applet_api\WikiController@info');
Route::post('/applet_api/wiki/like', 'App\Http\Controllers\applet_api\WikiController@like')->middleware('AppMiddleware');
Route::post('/applet_api/wiki/collection', 'App\Http\Controllers\applet_api\WikiController@collection')->middleware('AppMiddleware');
Route::post('/applet_api/wiki/comment', 'App\Http\Controllers\applet_api\WikiController@comment')->middleware('AppMiddleware');
Route::post('/applet_api/wiki/comment/like', 'App\Http\Controllers\applet_api\WikiController@commentLike')->middleware('AppMiddleware');

Route::post('/applet_api/train', 'App\Http\Controllers\applet_api\TrainController@index');
Route::get('/applet_api/train/{id}', 'App\Http\Controllers\applet_api\TrainController@info');
Route::post('/applet_api/train/enroll', 'App\Http\Controllers\applet_api\EnrollController@store');

Route::post('/applet_api/interaction', 'App\Http\Controllers\applet_api\InteractionController@index');
Route::put('/applet_api/interaction', 'App\Http\Controllers\applet_api\InteractionController@store')->middleware('AppMiddleware');
Route::get('/applet_api/interaction/{id}', 'App\Http\Controllers\applet_api\InteractionController@info')->middleware('AppAuthMiddleware');
Route::post('/applet_api/interaction/like', 'App\Http\Controllers\applet_api\InteractionController@like')->middleware('AppMiddleware');
Route::post('/applet_api/interaction/collection', 'App\Http\Controllers\applet_api\InteractionController@collection')->middleware('AppMiddleware');
Route::put('/applet_api/interaction/comment', 'App\Http\Controllers\applet_api\InteractionController@comment')->middleware('AppMiddleware');
Route::patch('/applet_api/interaction/comment/like', 'App\Http\Controllers\applet_api\InteractionController@commentLike')->middleware('AppMiddleware');

Route::get('/applet_api/activity/{type?}', 'App\Http\Controllers\applet_api\ActivityController@index');
Route::get('/applet_api/activity_info/{id}', 'App\Http\Controllers\applet_api\ActivityController@info');


Route::post('/applet_api/recruit', 'App\Http\Controllers\applet_api\RecruitController@index')->middleware('AppMiddleware');
Route::post('/applet_api/recruit/lists', 'App\Http\Controllers\applet_api\RecruitController@lists');
Route::post('/applet_api/recruit_delete', 'App\Http\Controllers\applet_api\RecruitController@delete')->middleware('AppMiddleware');
Route::post('/applet_api/recruit_info/{id}', 'App\Http\Controllers\applet_api\RecruitController@info')->middleware('AppMiddleware');
Route::post('/applet_api/recruit_columns', 'App\Http\Controllers\applet_api\RecruitController@columns')->middleware('AppMiddleware');
Route::post('/applet_api/recruit_address', 'App\Http\Controllers\applet_api\RecruitController@address')->middleware('AppMiddleware');
Route::post('/applet_api/recruit_edit', 'App\Http\Controllers\applet_api\RecruitController@edit')->middleware('AppMiddleware');
Route::post('/applet_api/recruit_company', 'App\Http\Controllers\applet_api\RecruitController@companyEdit')->middleware('AppMiddleware');
Route::post('/applet_api/recruit_company_welfare', 'App\Http\Controllers\applet_api\RecruitController@welfare')->middleware('AppMiddleware');
Route::post('/applet_api/recruit_company_info', 'App\Http\Controllers\applet_api\RecruitController@companyInfo')->middleware('AppMiddleware');
Route::post('/applet_api/recruit/resume', 'App\Http\Controllers\applet_api\RecruitController@resume')->middleware('AppMiddleware');

Route::post('/applet_api/resume', 'App\Http\Controllers\applet_api\ResumeController@index');
Route::get('/applet_api/resume/{id}', 'App\Http\Controllers\applet_api\ResumeController@info');

Route::post('/applet_api/WxAppLoad', 'App\Http\Controllers\UploadController@WxAppLoad')->middleware('AppMiddleware');
Route::post('/applet_api/WxAppOneLoad', 'App\Http\Controllers\UploadController@WxAppOneLoad')->middleware('AppMiddleware');
Route::post('/applet_api/vip', 'App\Http\Controllers\applet_api\VipController@index');
Route::post('/applet_api/isvip', 'App\Http\Controllers\applet_api\VipController@isvip')->middleware('AppMiddleware');
Route::post('/applet_api/pay_status', 'App\Http\Controllers\applet_api\VipController@pay_status');//马上废弃

Route::post('/applet_api/product', 'App\Http\Controllers\applet_api\ProductController@index');
Route::post('/applet_api/product/info/{id}', 'App\Http\Controllers\applet_api\ProductController@info');
Route::post('/applet_api/productType', 'App\Http\Controllers\applet_api\ProductController@types');
Route::post('/applet_api/product/form', 'App\Http\Controllers\applet_api\ProductController@form')->middleware('AppMiddleware');

Route::post('/applet_api/cart_item', 'App\Http\Controllers\applet_api\CartItemController@index')->middleware('AppMiddleware');
Route::post('/applet_api/cart_item/store', 'App\Http\Controllers\applet_api\CartItemController@store')->middleware('AppMiddleware');
Route::post('/applet_api/cart_item/update', 'App\Http\Controllers\applet_api\CartItemController@update')->middleware('AppMiddleware');
Route::post('/applet_api/cart_item/delete/{id}', 'App\Http\Controllers\applet_api\CartItemController@delete')->middleware('AppMiddleware');
Route::post('/applet_api/cart_item/deleteAll', 'App\Http\Controllers\applet_api\CartItemController@deleteAll')->middleware('AppMiddleware');

Route::post('/applet_api/course', 'App\Http\Controllers\applet_api\CourseController@index');
Route::post('/applet_api/course/type', 'App\Http\Controllers\applet_api\CourseController@type');
Route::post('/applet_api/course/info/{id}', 'App\Http\Controllers\applet_api\CourseController@info')->middleware('AppAuthMiddleware');
Route::post('/applet_api/course/study', 'App\Http\Controllers\applet_api\CourseController@study')->middleware('AppAuthMiddleware');

Route::get('/applet_api/course/index/{type}', 'App\Http\Controllers\applet_api\CoursePageController@index');

Route::post('/applet_api/information', 'App\Http\Controllers\applet_api\InformationController@index');
Route::get('/applet_api/information/type', 'App\Http\Controllers\applet_api\InformationController@types');
Route::get('/applet_api/information/info/{id}', 'App\Http\Controllers\applet_api\InformationController@info')->middleware('AppMiddleware');
Route::post('/applet_api/information/like', 'App\Http\Controllers\applet_api\InformationController@like')->middleware('AppMiddleware');
Route::post('/applet_api/information/collect', 'App\Http\Controllers\applet_api\InformationController@collect')->middleware('AppMiddleware');

Route::post('/applet_api/node', 'App\Http\Controllers\applet_api\NodeController@index');
Route::post('/applet_api/node/type', 'App\Http\Controllers\applet_api\NodeController@types');
Route::get('/applet_api/node/info/{id}', 'App\Http\Controllers\applet_api\NodeController@info')->middleware('AppAuthMiddleware');
Route::post('/applet_api/node/like', 'App\Http\Controllers\applet_api\NodeController@like')->middleware('AppMiddleware');
Route::post('/applet_api/node/collect', 'App\Http\Controllers\applet_api\NodeController@collect')->middleware('AppMiddleware');


Route::post('/applet_api/user/list', 'App\Http\Controllers\applet_api\UserController@index')->middleware('AppMiddleware');
Route::post('/applet_api/user', 'App\Http\Controllers\applet_api\UserController@info')->middleware('AppMiddleware');

Route::post('/applet_api/user/collect', 'App\Http\Controllers\applet_api\UserController@collect')->middleware('AppMiddleware');
Route::post('/applet_api/user/comment', 'App\Http\Controllers\applet_api\UserController@comment')->middleware('AppMiddleware');
Route::patch('/applet_api/user/concern', 'App\Http\Controllers\applet_api\UserController@concern_edit')->middleware('AppMiddleware');
Route::get('/applet_api/user/integral', 'App\Http\Controllers\applet_api\UserController@integral')->middleware('AppMiddleware');
Route::put('/applet_api/user/integral', 'App\Http\Controllers\applet_api\UserController@integralStore')->middleware('AppMiddleware');
Route::get('/applet_api/user/{id}', 'App\Http\Controllers\applet_api\UserController@show')->middleware('AppAuthMiddleware');


Route::post('/applet_api/order', 'App\Http\Controllers\applet_api\OrderController@index')->middleware('AppMiddleware');

Route::post('/applet_api/border', 'App\Http\Controllers\applet_api\BrotherController@index');
Route::get('/applet_api/border/{id}', 'App\Http\Controllers\applet_api\BrotherController@info');

Route::post('/applet_api/resources', 'App\Http\Controllers\applet_api\ResourcesController@index');
Route::get('/applet_api/resources/info/{id}', 'App\Http\Controllers\applet_api\ResourcesController@info');

Route::post('/applet_api/company', 'App\Http\Controllers\applet_api\CompanyController@index');
Route::get('/applet_api/company/info/{id}', 'App\Http\Controllers\applet_api\CompanyController@info');
Route::post('/applet_api/company/job/list', 'App\Http\Controllers\applet_api\CompanyController@jobList');

// --------------------------------------------------------------------------------------------------------------------------------

Route::any('/Statistics', 'App\Http\Controllers\statistics\StatisticsController@index');
Route::post('/StudyResult', 'App\Http\Controllers\statistics\StudyResultController@index');
Route::post('/StudyResult/completeUser', 'App\Http\Controllers\statistics\StudyResultController@completeUser');
Route::any('/PersonalImport', 'App\Http\Controllers\ImportUserController@index');
Route::any('/PersonalImport/import', 'App\Http\Controllers\ImportUserController@import');
Route::patch('/company/config', 'App\Http\Controllers\org\OrgConfigController@edit')->middleware('XinZhuMiddleware');
Route::post('/company/config', 'App\Http\Controllers\org\OrgConfigController@index')->middleware('XinZhuMiddleware');

Route::post('/CourseStudyRecord', 'App\Http\Controllers\StudyReaordController@index')->middleware('cors-should');

Route::post('/CourseStudylog', 'App\Http\Controllers\StudyLogController@index')->middleware('XinZhuMiddleware');
Route::post('/StudyStatistics', 'App\Http\Controllers\StudyController@index')->middleware('XinZhuMiddleware');
Route::post('/xinzhu/recruit_company_info', 'App\Http\Controllers\applet\RecruitController@companyInfo')->middleware('XinZhuMiddleware');


Route::any('/City', 'App\Http\Controllers\CityController@index');
Route::post('/getToken', 'App\Http\Controllers\UploadController@getToken');
Route::any('/Upload', 'App\Http\Controllers\UploadController@index');
Route::any('/upload/WxAppOneLoad', 'App\Http\Controllers\UploadController@WxAppOneLoad');
Route::any('/upload/XiuMiImg', 'App\Http\Controllers\UploadController@XiuMiImg');
Route::any('/upload/XiuMiImgLoad', 'App\Http\Controllers\UploadController@XiuMiImgLoad');
Route::any('/upload/upLoadFIle', 'App\Http\Controllers\UploadController@upLoadFIle')->middleware('XinZhuMiddleware');
Route::post('/common', 'App\Http\Controllers\common\CommonController@index')->middleware('XinZhuMiddleware');
Route::put('/common', 'App\Http\Controllers\common\CommonController@store')->middleware('XinZhuMiddleware');



Route::group(['prefix' => 'platform'], function () {
    Route::post('/course/syncClass', 'App\Http\Controllers\platform\CourseController@syncClass');
    Route::post('/course', 'App\Http\Controllers\platform\CourseController@index')->middleware('XinZhuMiddleware');
    Route::post('/company/course', 'App\Http\Controllers\platform\CompanyCourseController@index')->middleware('XinZhuMiddleware');
    Route::post('/course/study/{id}', 'App\Http\Controllers\platform\CourseController@study')->middleware('XinZhuMiddleware');
    Route::post('/course/studyLog', 'App\Http\Controllers\platform\StudyLogController@index')->middleware('XinZhuMiddleware');
    
    Route::post('/course/studyXz/{id}', 'App\Http\Controllers\platform\CourseController@studyXz');

    Route::get('/live/{id}', 'App\Http\Controllers\platform\LiveController@info');
    Route::post('/live/edit', 'App\Http\Controllers\platform\LiveController@edit')->middleware('XinZhuMiddleware');
    Route::patch('/live/push', 'App\Http\Controllers\platform\LiveController@push')->middleware('XinZhuMiddleware');
    
    Route::patch('/personal', 'App\Http\Controllers\platform\PersonalController@update')->middleware('XinZhuMiddleware');
    Route::post('/app/getPhoneNumber', 'App\Http\Controllers\platform\PersonalController@getPhoneNumber');
    Route::post('/app/session_key', 'App\Http\Controllers\platform\PersonalController@session_key');

    Route::post('/studyRecord', 'App\Http\Controllers\platform\StudyReaordController@index')->middleware('XinZhuMiddleware');
    Route::post('rank/studyTime', 'App\Http\Controllers\platform\RankController@studyTime')->middleware('XinZhuMiddleware');

    Route::post('/user/studyTime', 'App\Http\Controllers\platform\UserController@studyTime')->middleware('XinZhuMiddleware');

    Route::post('/task/studyInfo', 'App\Http\Controllers\platform\TaskController@studyInfo')->middleware('XinZhuMiddleware');

    Route::post('/common', 'App\Http\Controllers\platform\CommonController@index')->middleware('XinZhuMiddleware');
    Route::put('/common', 'App\Http\Controllers\platform\CommonController@store')->middleware('XinZhuMiddleware');
    Route::post('/common/delete', 'App\Http\Controllers\platform\CommonController@delete')->middleware('XinZhuMiddleware');

    Route::put('/files', 'App\Http\Controllers\platform\FileController@store')->middleware('XinZhuMiddleware');

});

Route::group(['prefix' => 'platform_app'], function () {
    Route::patch('/login', 'App\Http\Controllers\platform\PersonalController@update')->middleware('XinZhuMiddleware');
});

